package com.mall.huohuo.process;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.HashMap;
import java.util.Map;

/**
 * @author zycoding
 */
@Data
@Accessors(chain = true)
@NoArgsConstructor
public class NodeContext{

    private String processName;

    private String requestId;


    private Map<String,Object> DATA_MAP = new HashMap<String,Object>();

    private Pipeline pipeline;

    /**
     * 获取实体对象应用方需要类型转换
     * @param key
     * @return
     */
    public Object getDataEntityByKey(String key){
        return DATA_MAP.get(key);
    }

    /**
     * 设置实体
     * @param key 实体的key
     * @param data 实体
     */
    public void setDataEntity(String key,Object data){
        DATA_MAP.put(key, data);
    }
}
